<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="id" prop="id">
        <el-input
          v-model="queryParams.id"
          placeholder="请输入id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="案卷编号" prop="listno">
        <el-input
          v-model="queryParams.listno"
          placeholder="请输入案卷编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工程Id" prop="regprojid">
        <el-input
          v-model="queryParams.regprojid"
          placeholder="请输入工程Id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="oldid">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.oldid"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="ruleflag">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.ruleflag"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="rulepid">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.rulepid"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="档号" prop="volumeno">
        <el-input
          v-model="queryParams.volumeno"
          placeholder="请输入档号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="sumflag">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.sumflag"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="topid">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.topid"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="分类id" prop="indexId" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.indexId"
          placeholder="请输入分类id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="【废弃】工程id，有重复列" prop="projid" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.projid"
          placeholder="请输入【废弃】工程id，有重复列"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="vflag">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.vflag"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="案卷名称" prop="vname">
        <el-input
          v-model="queryParams.vname"
          placeholder="请输入案卷名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="year">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.year"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="glidenum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.glidenum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="filingflag">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.filingflag"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="检查标志" prop="checkupflag" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.checkupflag"
          placeholder="请输入检查标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="拆卷标志" prop="openflag" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.openflag"
          placeholder="请输入拆卷标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="完成标志" prop="finishflag" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.finishflag"
          placeholder="请输入完成标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="vtagnum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.vtagnum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="vnum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.vnum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="vtmpnum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.vtmpnum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="roomnum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.roomnum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="efilenum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.efilenum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="boxnum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.boxnum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="文件题名" prop="tname">
        <el-input
          v-model="queryParams.tname"
          placeholder="请输入文件题名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="编制单位" prop="buildorganization" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.buildorganization"
          placeholder="请输入编制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="【废弃】编制时间" prop="buildorganizationdate" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.buildorganizationdate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择【废弃】编制时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="数量/单位" prop="amount" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.amount"
          placeholder="请输入数量/单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="纸张规格" prop="spec" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.spec"
          placeholder="请输入纸张规格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文件开始时间" prop="filestart" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.filestart"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择文件开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="fileend" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.fileend"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择结束时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="保存期限" prop="savetime" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.savetime"
          placeholder="请输入保存期限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="级别" prop="securitylayer" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.securitylayer"
          placeholder="请输入级别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主题词" prop="thematic" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.thematic"
          placeholder="请输入主题词"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="附注" prop="annotations" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.annotations"
          placeholder="请输入附注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总页数" prop="totalpage" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.totalpage"
          placeholder="请输入总页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文字页数" prop="txtpage" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.txtpage"
          placeholder="请输入文字页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="图纸页数" prop="picpage" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.picpage"
          placeholder="请输入图纸页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="图片页数" prop="photopage" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.photopage"
          placeholder="请输入图片页数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建人" prop="cmen" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.cmen"
          placeholder="请输入创建人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="ctime" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.ctime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="校对人" prop="assessor" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.assessor"
          placeholder="请输入校对人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="校对时间" prop="atime" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.atime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择校对时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="是否在本地" prop="islocate" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.islocate"
          placeholder="请输入是否在本地"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="topnode">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.topnode"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="录制单位" prop="lcompany" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.lcompany"
          placeholder="请输入录制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="带长" prop="llen" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.llen"
          placeholder="请输入带长"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="立卷人" prop="injectionperson" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.injectionperson"
          placeholder="请输入立卷人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="立卷时间" prop="injectiondate" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.injectiondate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择立卷时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="审核人" prop="checkperson" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.checkperson"
          placeholder="请输入审核人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审核时间" prop="checkdate" v-if="showAdvancedSearch">
        <el-date-picker clearable
                        v-model="queryParams.checkdate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择审核时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="录制地点" prop="jplace" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.jplace"
          placeholder="请输入录制地点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="录制人" prop="jman" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.jman"
          placeholder="请输入录制人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="图号" prop="tnum" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.tnum"
          placeholder="请输入图号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="图纸比例" prop="tzoom" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.tzoom"
          placeholder="请输入图纸比例"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="tflag">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.tflag"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="tviewer">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.tviewer"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="tassessor">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.tassessor"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="${comment}" prop="tdesigner">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.tdesigner"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="版本号" prop="tvision" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.tvision"
          placeholder="请输入版本号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="finishday">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.finishday"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="总全宗号" prop="intmaxnum" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.intmaxnum"
          placeholder="请输入总全宗号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="全宗号" prop="fontsnum" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.fontsnum"
          placeholder="请输入全宗号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="全总名称" prop="fontsname" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.fontsname"
          placeholder="请输入全总名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工程id" prop="regprojid" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.regprojid"
          placeholder="请输入工程id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缩微号" prop="zoonum" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.zoonum"
          placeholder="请输入缩微号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="${comment}" prop="strmaxnum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.strmaxnum"-->
      <!--          placeholder="请输入${comment}"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="档案存储位置" prop="intvumlist" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.intvumlist"
          placeholder="请输入档案存储位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子档案保存路径" prop="path" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.path"
          placeholder="请输入电子档案保存路径"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="原实体档案存放位置" prop="storeposition" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.storeposition"
          placeholder="请输入原实体档案存放位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="预留1" prop="volumeYuliu1">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.volumeYuliu1"-->
      <!--          placeholder="请输入预留1"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="单位名称" prop="volumeYuliu2" v-if="showAdvancedSearch">
        <el-input
          v-model="queryParams.volumeYuliu2"
          placeholder="请输入单位名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label-width="110px" label="案卷流水号" prop="volumeYuliu3">
        <el-input
          v-model="queryParams.volumeYuliu3"
          placeholder="请输入案卷流水号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label-width="120px" label="档案盒流水号" prop="volumeYuliu4">
        <el-input
          v-model="queryParams.volumeYuliu4"
          placeholder="请输入档案盒流水号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button type="success" icon="el-icon-sort" size="mini" @click="toggleSearchMode">高级搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="multiple"
          @click="handleUpdate"

        >批量上架/修改
        </el-button>
<!--        v-hasPermi="['system:volumeinfo:edit']"-->
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="volumeinfoList" @selection-change="handleSelectionChange"
              @cell-click="handleCellClick" @cell-mouse-enter="handleCellEnter" @cell-mouse-leave="handleCellLeave">
      <el-table-column type="selection" width="55" align="center"/>
<!--      <el-table-column label="id" align="center" prop="id"/>-->
      <el-table-column label="案卷编号" align="center" prop="listno" v-if="columns[0].visible"/>
      <el-table-column label="档号" align="center" prop="volumeno" v-if="columns[1].visible"/>
      <el-table-column label="分类id" align="center" prop="indexId" v-if="columns[2].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="【废弃】工程id，有重复列" align="center" prop="projid" v-if="columns[3].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="案卷名称" align="center" prop="vname" v-if="columns[4].visible"/>
      <el-table-column label="检查标志" align="center" prop="checkupflag" v-if="columns[5].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="拆卷标志" align="center" prop="openflag" v-if="columns[6].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="完成标志" align="center" prop="finishflag" v-if="columns[7].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="案卷类型" align="center" prop="vtype" v-if="columns[8].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="文件题名" align="center" prop="tname" v-if="columns[9].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="编制单位" align="center" prop="buildorganization" v-if="columns[10].visible"/>
      <el-table-column label="【废弃】编制时间" align="center" prop="buildorganizationdate" v-if="columns[11].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.buildorganizationdate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="载体类型" align="center" prop="carrietype" v-if="columns[12].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="数量/单位" align="center" prop="amount" v-if="columns[13].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="纸张规格" align="center" prop="spec" v-if="columns[14].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="文件开始时间" align="center" prop="filestart" v-if="columns[15].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.filestart, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="fileend" v-if="columns[16].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.fileend, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="保存期限" align="center" prop="savetime" v-if="columns[17].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="级别" align="center" prop="securitylayer" v-if="columns[18].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="主题词" align="center" prop="thematic" v-if="columns[19].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="附注" align="center" prop="annotations" v-if="columns[20].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="文件总数" align="center" prop="totalfile" v-if="columns[21].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="总页数" align="center" prop="totalpage" v-if="columns[22].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="文字页数" align="center" prop="txtpage" v-if="columns[23].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="图纸页数" align="center" prop="picpage" v-if="columns[24].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="图片页数" align="center" prop="photopage" v-if="columns[25].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="创建人" align="center" prop="cmen" v-if="columns[26].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="创建时间" align="center" prop="ctime" width="180" v-if="columns[27].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.ctime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="校对人" align="center" prop="assessor" v-if="columns[28].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="校对时间" align="center" prop="atime" width="180" v-if="columns[29].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.atime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="content" v-if="columns[30].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="是否在本地" align="center" prop="islocate" v-if="columns[31].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="录制说明" align="center" prop="lcontent" v-if="columns[32].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="录制单位" align="center" prop="lcompany" v-if="columns[33].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="带长" align="center" prop="llen" v-if="columns[34].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="立卷人" align="center" prop="injectionperson" v-if="columns[35].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="立卷时间" align="center" prop="injectiondate" v-if="columns[36].visible"
                       :show-overflow-tooltip="true" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.injectiondate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核人" align="center" prop="checkperson" v-if="columns[37].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="审核时间" align="center" prop="checkdate" width="180" v-if="columns[38].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.checkdate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="录制地点" align="center" prop="jplace" v-if="columns[39].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="录制人" align="center" prop="jman" v-if="columns[40].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="图号" align="center" prop="tnum" v-if="columns[41].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="图纸比例" align="center" prop="tzoom" v-if="columns[42].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="版本号" align="center" prop="tvision" v-if="columns[43].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="总全宗号" align="center" prop="intmaxnum" v-if="columns[44].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="全宗号" align="center" prop="fontsnum" v-if="columns[45].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="全总名称" align="center" prop="fontsname" v-if="columns[46].visible"
                       :show-overflow-tooltip="true"/>
<!--      <el-table-column label="工程id" align="center" prop="regprojid" v-if="columns[47].visible"/>-->
      <el-table-column label="缩微号" align="center" prop="zoonum" v-if="columns[48].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="档案存储位置" align="center" prop="intvumlist" v-if="columns[49].visible">
        <div class="item" slot-scope="scope">
          <el-input class="item__input" v-model="scope.row.intvumlist" placeholder="请输入内容"></el-input>
          <div class="item__txt">{{ scope.row.intvumlist }}</div>
        </div>
      </el-table-column>
      <el-table-column label="电子档案保存路径" align="center" prop="path" v-if="columns[50].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="原实体档案存放位置" align="center" prop="storeposition" v-if="columns[51].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="预留1" align="center" prop="volumeYuliu1" v-if="columns[52].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="单位名称" align="center" prop="volumeYuliu2" v-if="columns[53].visible"
                       :show-overflow-tooltip="true"/>
      <el-table-column label="案卷流水号" align="center" prop="volumeYuliu3" v-if="columns[54].visible"/>
      <el-table-column label="档案盒流水号" align="center" prop="volumeYuliu4" v-if="columns[55].visible"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="columns[56].visible"
                       :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <el-button @click="save(scope.row)" type="text" size="small">保存</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改案卷表对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-form-item label="档案存储位置" prop="intvumlist">
          <el-input v-model="form.intvumlist" placeholder="请输入档案存储位置"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listVolumeinfo,
  updateVolumeinfo,
  getVolumeInfoById,
} from "@/api/system/volumeinfo";

export default {
  name: "Volumeinfo",
  data() {
    return {
      showAdvancedSearch: false, // 初始时为简单搜索模式
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 案卷表表格数据
      volumeinfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        listno: null,
        oldid: null,
        ruleflag: null,
        rulepid: null,
        volumeno: null,
        sumflag: null,
        topid: null,
        indexId: null,
        projid: null,
        vflag: null,
        vname: null,
        year: null,
        glidenum: null,
        filingflag: null,
        checkupflag: null,
        openflag: null,
        finishflag: null,
        vtagnum: null,
        vtype: null,
        vnum: null,
        vtmpnum: null,
        roomnum: null,
        efilenum: null,
        boxnum: null,
        tname: null,
        buildorganization: null,
        buildorganizationdate: null,
        carrietype: null,
        amount: null,
        spec: null,
        filestart: null,
        fileend: null,
        savetime: null,
        securitylayer: null,
        thematic: null,
        annotations: null,
        totalfile: null,
        totalpage: null,
        txtpage: null,
        picpage: null,
        photopage: null,
        cmen: null,
        ctime: null,
        assessor: null,
        atime: null,
        content: null,
        islocate: null,
        topnode: null,
        lcontent: null,
        lcompany: null,
        llen: null,
        injectionperson: null,
        injectiondate: null,
        checkperson: null,
        checkdate: null,
        jplace: null,
        jman: null,
        tnum: null,
        tzoom: null,
        tflag: null,
        tviewer: null,
        tassessor: null,
        tdesigner: null,
        tvision: null,
        finishday: null,
        intmaxnum: null,
        fontsnum: null,
        fontsname: null,
        regprojid: null,
        zoonum: null,
        strmaxnum: null,
        intvumlist: null,
        path: null,
        storeposition: null,
        volumeYuliu1: null,
        volumeYuliu2: null,
        volumeYuliu3: null,
        volumeYuliu4: null
      },
      // 表单参数
      form: {},
      idForm: {},
      // 列信息
      columns: [
        {key: 0, label: `案卷编号`, visible: false},
        {key: 1, label: `档号`, visible: true},
        {key: 2, label: `分类id`, visible: false},
        {key: 3, label: `【废弃】工程id，有重复列`, visible: false},
        {key: 4, label: `案卷名称`, visible: true},
        {key: 5, label: `检查标志`, visible: false},
        {key: 6, label: `拆卷标志`, visible: false},
        {key: 7, label: `完成标志`, visible: false},
        {key: 8, label: `案卷类型`, visible: false},
        {key: 9, label: `文件题名`, visible: false},
        {key: 10, label: `编制单位`, visible: true},
        {key: 11, label: `【废弃】编制时间`, visible: false},
        {key: 12, label: `载体类型`, visible: false},
        {key: 13, label: `数量/单位`, visible: false},
        {key: 14, label: `纸张规格`, visible: false},
        {key: 15, label: `文件开始时间`, visible: true},
        {key: 16, label: `结束时间`, visible: true},
        {key: 17, label: `保存期限`, visible: true},
        {key: 18, label: `级别`, visible: true},
        {key: 19, label: `主题词`, visible: false},
        {key: 20, label: `附注`, visible: false},
        {key: 21, label: `文件总数`, visible: false},
        {key: 22, label: `总页数`, visible: false},
        {key: 23, label: '文字页数', visible: false},
        {key: 24, label: `图纸页数`, visible: false},
        {key: 25, label: `图片页数`, visible: false},
        {key: 26, label: `创建人`, visible: false},
        {key: 27, label: `创建时间`, visible: false},
        {key: 28, label: `校对人`, visible: false},
        {key: 29, label: `校对时间`, visible: false},
        {key: 30, label: `备注`, visible: false},
        {key: 31, label: `是否在本地`, visible: false},
        {key: 32, label: `录制说明`, visible: false},
        {key: 33, label: `录制单位`, visible: false},
        {key: 34, label: `带长`, visible: false},
        {key: 35, label: `立卷人`, visible: false},
        {key: 36, label: `立卷时间`, visible: false},
        {key: 37, label: `审核人`, visible: false},
        {key: 38, label: `审核时间`, visible: false},
        {key: 39, label: `录制地点`, visible: false},
        {key: 40, label: `录制人`, visible: false},
        {key: 41, label: `图号`, visible: false},
        {key: 42, label: `图纸比例`, visible: false},
        {key: 43, label: `版本号`, visible: false},
        {key: 44, label: `总全宗号`, visible: false},
        {key: 45, label: `全宗号`, visible: false},
        {key: 46, label: `全总名称`, visible: false},
        {key: 47, label: '工程id', visible: true},
        {key: 48, label: `缩微号`, visible: false},
        {key: 49, label: `档案存储位置`, visible: true},
        {key: 50, label: `电子档案保存路径`, visible: false},
        {key: 51, label: `原实体档案存放位置`, visible: false},
        {key: 52, label: `预留1`, visible: false},
        {key: 53, label: `单位名称`, visible: false},
        {key: 54, label: `案卷流水号`, visible: true},
        {key: 55, label: `档案盒流水号`, visible: true},
        {key: 56, label: `操作`, visible: true},
      ],
      // 表单校验
      rules: {},
      editProp: ['intvumlist'],
      // 保存进入编辑的cell
      clickCellMap: {}
    };
  },
  created() {
    this.getList();
  },
  methods: {
    toggleSearchMode() {
      this.showAdvancedSearch = !this.showAdvancedSearch;
    },
    /** 查询案卷表列表 */
    getList() {
      this.loading = true;
      listVolumeinfo(this.queryParams).then(response => {
        this.volumeinfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        intvumlist: null
      };
      this.idForm = {
        id: null,
        ids: null
      };
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      if (this.ids.length === 0) {
        this.idForm.id = row.id;
      } else {
        this.idForm.ids = this.ids;
      }
      getVolumeInfoById(this.idForm).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "案卷上架/修改";
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.loading = true;
          const idArray = this.idForm.ids;
          idArray.forEach(id => {
            var params = {}
            params.id = id;
            params.intvumlist = this.form.intvumlist
            updateVolumeinfo(params).then(response => {
              this.$modal.msgSuccess(`ID为 ${id} 的数据修改成功`);
            });
          })
          this.open = false;
          this.getList();
          this.loading = false;
        }
      });
    },
    /** 鼠标移入cell */
    handleCellEnter(row, column, cell, event) {
      const property = column.property
      if (property === 'date' || property === 'name' || property === 'food') {
        cell.querySelector('.item__txt').classList.add('item__txt--hover')
      }
    },
    /** 鼠标移出cell */
    handleCellLeave(row, column, cell, event) {
      const property = column.property
      if (this.editProp.includes(property)) {
        cell.querySelector('.item__txt').classList.remove('item__txt--hover')
      }
    },
    /** 点击cell */
    handleCellClick(row, column, cell, event) {
      const property = column.property
      if (this.editProp.includes(property)) {
        // 保存cell
        this.saveCellClick(row, cell)
        cell.querySelector('.item__txt').style.display = 'none'
        cell.querySelector('.item__input').style.display = 'block'
        cell.querySelector('input').focus()
      }
    },
    /** 取消编辑状态 */
    cancelEditable(cell) {
      cell.querySelector('.item__txt').style.display = 'block'
      cell.querySelector('.item__input').style.display = 'none'
    },
    /** 保存进入编辑的cell */
    saveCellClick(row, cell) {
      const id = row.id
      if (this.clickCellMap[id] !== undefined) {
        if (!this.clickCellMap[id].includes(cell)) {
          this.clickCellMap[id].push(cell)
        }
      } else {
        this.clickCellMap[id] = [cell]
      }
    },
    /** 保存数据 */
    async save(row) {
      const id = row.id
      // 取消本行所有cell的编辑状态
      this.clickCellMap[id].forEach(cell => {
        this.cancelEditable(cell)
      })
      this.clickCellMap[id] = []
      await updateVolumeinfo(row).then(response => {
        this.$modal.msgSuccess("修改成功");
        this.open = false;
        this.getList();
      })
    }
  },
};
</script>
<style lang='scss'>
.item {
  .item__input {
    display: none;
    width: 150px;
    ///* 调整elementUI中样式 如果不需要调整请忽略 */
    //.el-input__inner{
    //  height: 24px!important;
    //}
    ///* 调整elementUI中样式 如果不需要调整请忽略 */
    //.el-input__suffix{
    //  i{
    //    font-size: 12px !important;
    //    line-height: 26px !important;
    //  }
    //}
  }

  .item__txt {
    //box-sizing: border-box;
    line-height: 24px;
    //padding: 0 9px;
  }
}
</style>
